# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-dbus-fast
pkgver=2.24.3
pkgrel=0
pkgdesc="A faster version of dbus-next"
url="https://github.com/bluetooth-devices/dbus-fast/"
arch="all"
license="MIT"
depends="
	dbus
	python3
	"
makedepends="
	cython
	poetry
	python3-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-pytest-asyncio
	py3-pytest-cov
	py3-pytest-timeout
	"
subpackages="$pkgname-doc $pkgname-pyc"
source="py3-dbus-fast-$pkgver.tar.gz::https://github.com/bluetooth-devices/dbus-fast/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/dbus-fast-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl

	dbus-run-session -- .testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
a75b64c3a7a99e37aabb12d05a18b086b8a11104ef703871d800bc997260423f923a00d3fafbfb661408f96fa0133d50f79231515052642d8b1977c34c923e77  py3-dbus-fast-2.24.3.tar.gz
"
